<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ page import="com.mymail.entity.*" %>
<%
	//request.setCharacterEncoding("UTF-8");
	String username = request.getParameter("username");
	String password = request.getParameter("password");
	//System.out.println(username);	
%>
<jsp:useBean id="user" class="com.mymail.entity.User" scope="session"></jsp:useBean>
<%
	boolean b=User.getByName(username,user);
	if(b && user.getId()!=null && password.equals(user.getPassword())){
		session.setAttribute("username",user.getName());
		out.print("OK");
	} else {
		out.print("用户名或密码错误");
	}
%>